var express = require('express');
var router = express.Router();
var fileUtil = require("../util/fileUtil");

/* GET home page. */
router.get('/', function (req, res, next) {
    var files = fileUtil.findSync("./public/src/");
    files = files.filter(function (val,index,args) {
        return /.*\.html|htm/.test(val);
    });
    res.render('index', {files: files});
});
router.get('/test', function (req, res, next) {
    res.end("<html><head><meta charset=\"UTF-8\"></head><body><ol><li>钩子</li><li>大牛</li><li>大牛2</li></ol></body></html>");
})

module.exports = router;
